//
//  CustomeNavigationVC.m
//  Nooryes
//
//  Created by 高博昆 on 15/6/4.
//  Copyright (c) 2015年 Jason. All rights reserved.
//

#import "CustomeNavigationVC.h"
#import "Account.h"
#import "LoginViewController.h"
#import "CustomRefreshHeader.h"
#import "PlistStorage.h"
#import "WGKeychain.h"
#import "U9CatagoryModel.h"
#import "LeftMenuViewController.h"
#import "U9LeftMenuViewModel.h"
#import "CustomeOverView.h"
#import "MatchHomeViewController.h"
#import "FindViewController.h"

@interface CustomeNavigationVC ()<UIGestureRecognizerDelegate>


@end

@implementation CustomeNavigationVC

+(void)load{
    [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor],NSFontAttributeName:[UIFont boldSystemFontOfSize:18]}];
    //        [[UINavigationBar appearance] setBarTintColor:UIColorFromRGB(kAllWhiteColor)];
    [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"navibackimg"] forBarMetrics:UIBarMetricsDefault];
    [[UINavigationBar appearance] setTintColor:UIColorFromRGB(0xffffff)];
    //        [[UINavigationBar appearance] setTranslucent:YES];
    [[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    //    if([self.navigationBar respondsToSelector:@selector(setTintColor:)]) {
    //
    //
    //    }
    
    self.interactivePopGestureRecognizer.enabled = NO;
    id target = self.interactivePopGestureRecognizer.delegate;
    UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:target action:@selector(handleNavigationTransition:)];
    pan.delegate = self;
    [self.view addGestureRecognizer:pan];
}


- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
    if (self.viewControllers.count) {
        viewController.hidesBottomBarWhenPushed = YES;
    }
    [super pushViewController:viewController animated:animated];
}


//  cause set statusbar based on viewcontroller is NO ; so the bove setting is not work;
//  and we only set [UIApplication sharedApplication].statusbar = light or defult in sign viewcontroller
//  and preferredStatusBarStyle in sign viewcontroller is not work too;

//- (UIViewController *)childViewControllerForStatusBarHidden{
//
//    return self.topViewController;
//}
//
//- (UIStatusBarStyle)preferredStatusBarStyle
//{
//    UIViewController* topVC = self.topViewController;
//    return [topVC preferredStatusBarStyle];
//}



//- (UIStatusBarStyle)preferredStatusBarStyle{
//    return UIStatusBarStyleLightContent;
//
//}
@end
